﻿/*
 *  Author: Louis A. Leskoviansky
 *  Company: Artemis Solutions Group (http://www.artemis-solutions.com)
 */


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.UI;

namespace AjaxControlFramework
{
	public class AjaxUserControl : UserControl, IAjaxControl
	{
		//------// Properties \\--------------------------------------------\\
		public virtual AjaxControlContext AjaxContext { get; set; }

		public virtual bool IsUpdating { get; set; }

        public virtual StateStrategy StateStrategy { get; set; }
		public virtual CallbackStrategy CallbackStrategy { get; set; }
		//------\\ Properties //--------------------------------------------//



		//------// Constructors \\------------------------------------------\\
		public AjaxUserControl(string appRelativeVirtualPath)
		{
            base.AppRelativeVirtualPath = appRelativeVirtualPath;
            AjaxControl.Initialize(this);
		}
		//------\\ Constructors //------------------------------------------//



		//------// Methods \\-----------------------------------------------\\
		public void RaiseCallbackEvent(string eventArgs)
		{
			CallbackStrategy.ProcessCallback<CallbackStrategyArguments>(eventArgs);
		}


		public string GetCallbackResult()
		{
			return CallbackStrategy.GenerateCallbackResult();
		}
		//------\\ Methods //-----------------------------------------------//
	}
}
